export function compatibleStorage(key, session = false) {
  //#ifdef MP-WEIXIN
   return uni.getStorageSync(key)
  //#endif
	//#ifdef H5
	let storage = ''
	if (!session) {
		storage = localStorage.getItem(key)
	} else {
		storage = sessionStorage.getItem(key)
	}
	if (!storage) return ''
	storage = storage.startsWith('{') ? JSON.parse(storage) : storage
	if (typeof storage == 'object' && storage.type) {
		return storage.data
	} else {
		return storage
	}
	//#endif
}
